calculate_coordinates Subroutine

public subroutine calculate_coordinates(current_index, ix, iy, iz, nx, ny, nz, coordinates, node_type)

Subroutine to calculate the coordinates of the units inside a kohonen layer

Type Bound

two_level_self_organizing_map

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: current_index

Integer variables

integer, intent(in) :: ix

Integer variables

integer, intent(in) :: iy

Integer variables

integer, intent(in) :: iz

Integer variables

integer, intent(in) :: nx

Integer variables

integer, intent(in) :: ny

Integer variables

integer, intent(in) :: nz

Integer variables

real(kind=wp), intent(out), dimension(:,:) :: coordinates

Real array

character(len=*), intent(in) :: node_type

Character variable


Called by

proc~~calculate_coordinates~2~~CalledByGraph proc~calculate_coordinates~2 two_level_self_organizing_map%calculate_coordinates proc~read_som_layer two_level_self_organizing_map%read_som_layer proc~read_som_layer->proc~calculate_coordinates~2

Source Code

   subroutine calculate_coordinates(current_index,ix,iy,iz,nx,ny,nz,coordinates,node_type)
   !========================================================================================
!! Subroutine to calculate the coordinates of the units inside a kohonen layer 
   integer,intent(in) :: current_index,ix,iy,iz,nx,ny,nz
!! Integer variables
   real(kind=wp),dimension(:,:),intent(out) :: coordinates
!! Real array
   character(len=*),intent(in) :: node_type
!! Character variable
   coordinates(current_index,1)=dble(ix);
   coordinates(current_index,2)=dble(iy);
   coordinates(current_index,3)=dble(iz);
   if(trim(node_type) .eq. 'hexagonal') then
      coordinates(current_index,1)=coordinates(current_index,1)+&
                  .5_wp*(mod(coordinates(current_index,2),2.0_wp));
      coordinates(current_index,2)=(dsqrt(3.0_wp)/2._wp)*coordinates(current_index,2);
   endif
   !
   end subroutine calculate_coordinates